<!DOCTYPE html>
<html>
    {% load static %}
<!-- import CSS -->


<!-- Bootstrap core CSS -->
<link href="{% static 'assets/css/bootstrap.css' %}" rel="stylesheet">
<!--external css-->
<link href="{% static 'assets/font-awesome/css/font-awesome.css' %}" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="{% static 'assets/css/style.css' %}" rel="stylesheet">
<link href="{% static 'assets/css/style-responsive.css' %}" rel="stylesheet">
<!-- js placed at the end of the document so the pages load faster -->
<script src="{% static 'assets/js/jquery.js' %}"></script>
<script src="{% static 'assets/js/bootstrap.min.js' %}"></script>
<script class="include" type="text/javascript" src="{% static 'assets/js/jquery.dcjqaccordion.2.7.js' %}"></script>
<script src="{% static 'assets/js/jquery.scrollTo.min.js' %}"></script>
<script src="{% static 'assets/js/jquery.nicescroll.js' %}" type="text/javascript"></script>
<!--common script for all pages-->
<script src="{% static 'assets/js/common-scripts.js' %}"></script>
<!--script for this page-->
<!-- 引入刚刚下载的 ECharts 文件 -->
<script src="{% static 'assets/js/echarts.js' %}"></script>
<script src="{% static 'assets/js/highlight.min.js' %}"></script>
    <script>
        hljs.highlightAll();
    </script>

    <script src="{% static 'assets/dist/notice.min.js' %}"></script>
    <script>
        const notice = new Notice();
    </script>
    <script src="{% static 'assets/js/main.js' %}"></script>
    <link rel="stylesheet" href="{% static 'assets/css/style.css' %}">
    <link rel="stylesheet" href="{% static 'assets/dist/notice.min.css' %}">
    <link rel="stylesheet" href="{% static 'assets/css/default.min.css' %}">

    <link href="{% static 'assets/css/purchase.css' %}" rel="stylesheet">


  <body>

  <section id="container" >
      <!-- **********************************************************************************************************************************************************
      TOP BAR CONTENT & NOTIFICATIONS
      *********************************************************************************************************************************************************** -->
      <!--header start-->
      <header class="header black-bg">
        <div class="sidebar-toggle-box">
            <div class="fa fa-bars tooltips" data-placement="right" data-original-title="Toggle Navigation"></div>
        </div>
      <!--logo start-->
      <a href="index.html" class="logo"><b>MD集团物料管理系统</b></a>
      <!--logo end-->
      <div class="nav notify-row" id="top_menu">
          <!--  notification start -->
      
  </header>
<!--header end-->

<!-- **********************************************************************************************************************************************************
MAIN SIDEBAR MENU
*********************************************************************************************************************************************************** -->
<!--sidebar start-->
<aside>
    <div id="sidebar"  class="nav-collapse ">
        <!-- sidebar menu start-->
        <ul class="sidebar-menu" id="nav-accordion">
        
              <p class="centered"><img src="{% static 'assets/img/ui-sam.jpg' %}" class="img-circle" width="60"></a></p>
              <h5 class="centered">物料管理</h5>
                  
            <li class="mt">
                <a href="{% url 'MM:login' %}">
                    <i class="fa fa-dashboard"></i>
                    <span>主页</span>
                </a>
            </li>

            <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-desktop"></i>
                    <span>供应商管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="general.html">创建新供应商</a></li>
                    <li><a  href="buttons.html">查看或修改供应商信息</a></li>
                    {% comment %} <li><a  href="panels.html">Panels</a></li> {% endcomment %}
                </ul>
            </li>

            <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-cogs"></i>
                    <span>商品管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="calendar.html">创建新商品</a></li>
                    <li><a  href="gallery.html">查看或修改商品信息</a></li>
                    <li><a  href="todo_list.html">查看商品库存</a></li>
                </ul>
            </li>
            {% comment %} <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-book"></i>
                    <span>采购订单管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="blank.html">Blank Page</a></li>
                    <li><a  href="login.html">Login</a></li>
                    <li><a  href="lock_screen.html">Lock Screen</a></li>
                </ul>
            </li> {% endcomment %}
            <li class="sub-menu">
                <a class="active" href="javascript:;" >
                    <i class="fa fa-tasks"></i>
                    <span>收货管理</span>
                </a>
                <ul class="sub">
                    <li class="active"><a  href="form_component.html">创建商品收据</a></li>
                    <li class="active"><a  href="form_component.html">查看商品收据</a></li>
                    <li class="active"><a  href="form_component.html">创建发票收据</a></li>
                    <li class="active"><a  href="form_component.html">查看发票收据</a></li>
                    <li class="active"><a  href="form_component.html">付款</a></li>
                </ul>
            </li>
            <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-th"></i>
                    <span>采购订单管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="/mm/purchaserequisition/getpq/">采购申请</a></li>
                    <li><a  href="/mm/quotation/vreview/">供应商评估管理</a></li>
                    <li><a  href="/mm/purchaseorder/searchpo/">采购订单</a></li>
                </ul>
            </li>
            

        </ul>
        <!-- sidebar menu end-->
    </div>
</aside>
      <!--sidebar end-->
      
      <!-- **********************************************************************************************************************************************************
      MAIN CONTENT
      *********************************************************************************************************************************************************** -->
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
          	<h3><i class="fa fa-angle-right"></i> 查询报价申请</h3>
              <div class="row mt">
                <div class="col-lg-12">
                    
                <div class="form-panel3">
                    
                    <form class="form-horizontal style-form" method="post">
             
                            <div class="col-sm-9" id="rfq-search">
                    
                                <div id="rfq-search-row1">
                                    
                                    <div class="col-sm-1 col-sm-1 control-label" id="rfq-1">
                                        报价申请单编码
                                    </div>
                                    <div class="col-sm-2" id="rfq-search1">
                                        <input type="text" class="form-control"  name = "id" placeholder="请输入" >
                                    </div>
                                   
                                    <div class="col-sm-1 col-sm-1 control-label" id="rfq-2">
                                        供应商编码
                                    </div>
                                    <div class="col-sm-2" id="rfq-search3">
                                        <input type="text" class="form-control" name = "vendorvid" id="gyscode"  placeholder="请输入" >
                                        <button type="button" class="btn btn-link " data-toggle="modal" data-target="#myModalgys">忘记编号？</button>
  
        
                                    </div>
                                    <div class="col-sm-1 col-sm-1 control-label" id="rfq-3" style="width:160px">
                                            参考请购条目编码
                                    </div>
                                    <div class="col-sm-2" id="rfq-search4">
                                        <input type="text" class="form-control" name="riid" placeholder="请输入" id="spcode">
                                    </div>
                                    </div>
<br>
                                    <div id="rfq-search-row2">
                                        <div class="col-sm-1 col-sm-1 control-label" id="rfq-4">
                                            集合码
                                        </div>
                                        <div class="col-sm-2" id="rfq-search2">
                                            <input type="text" class="form-control" name = "collNo" placeholder="请输入">
                                        </div>
                                    <div class="col-sm-1 col-sm-1 control-label" id="rfq-5">
                                        创建者编码
                                    </div>
                                    <div class="col-sm-2" id="rfq-search5">
                                        <input type="text" class="form-control" placeholder="请输入" name = "euserid" onclick="openInsertModal()" id="cjzcode">
                                    </div>
                                    <button type="submit" class="btn btn-success" id="btn-rfq-search">搜索</button>
                                        </div>
                 <br><br><br>
                                      
                                         
                                    <div class="col-sm-1">
                                       
                                    </div>
                                {{ quotation }}

                                <!-- </div> -->
                            </div>
                            <!-- <div class="col-lg-3">
                                
                            </div> -->
                    </form>
                    
                </div>
            </div>
            </div>
           
            
   <!--搜索供应商编码modal-->
   <div class="modal fade" id="myModalgys" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">搜索供应商编号</h4>
        </div>
        <div class="modal-body">
          <!-- Hi there, I am a Modal Example for Dashgum Admin Panel. -->
          <!-- 搜索条件 -->
          <form  id="material2" class="form-horizontal style-form">
            <div class="form-group">
                <!-- <label class="col-sm-1 col-sm-1 control-label"></label> -->
                <label class="col-sm-4 col-sm-4 control-label">
                    <div class="pull-right">供应商名称：</div>
                    </label>
                <div class="col-sm-5">
                    <input name="vname" id="vname" type="text" class="form-control">
                </div>
                
            </div>
            <div class="form-group">
                <!-- <label class="col-sm-1 col-sm-1 control-label"></label> -->
                <label class="col-sm-4 col-sm-4 control-label">
                    <div class="pull-right">所在城市：</div>
                    </label>
                <div class="col-sm-5">
                    <input name="city" id="city" type="text" class="form-control">
                </div>
                
            </div>
            <div class="form-group">
                <!-- <label class="col-sm-1 col-sm-1 control-label"></label> -->
                <label class="col-sm-4 col-sm-4 control-label">
                    <div class="pull-right">创建者编号：</div>
                    </label>
                <div class="col-sm-5">
                    <input name="uid" id="uid" type="text" class="form-control">
                </div>
                
            </div>
            <div class="form-group">
                <!-- <label class="col-sm-1 col-sm-1 control-label"></label> -->
                <label class="col-sm-4 col-sm-4 control-label">
                    <div class="pull-right">国家：</div>
                    </label>
                <div class="col-sm-5">
                  <select class="form-control"  name="country" id="country"></select>
                </div>
                
            </div>
            <div class="form-group">
              <!-- <label class="col-sm-1 col-sm-1 control-label"></label> -->
              <label class="col-sm-4 col-sm-4 control-label">
                  <div class="pull-right">公司编码：</div>
                  </label>
              <div class="col-sm-5">
                  <select class="form-control"  name="company" id="company"></select>
              </div>
              <div class="col-sm-2">
              <input type="submit"  class="btn btn-theme02">
              </div>
          </div>

        </form>
        <table  class="table table-bordered table-striped table-condensed">
          *双击填入编号                                       
          <thead>
          <!-- 搜索编号返回的属性 style="width: 100px;"-->
          <tr>
              <th> 供应商编号</th>
              <th> 供应商名称</th>
              <th> 所在城市</th>
              <th> 公司编码</th>
              <th> 创建者编号</th>
          </tr>
          </thead>
          <tbody id="searchDiv"></tbody>
      </table>
        <script>

            $('#material2').on('submit', function(e) {
                e.preventDefault();
                $.ajax(
                {
                    type: "POST",
                    url: "{% url 'MM:ajax_search_vendor' %}",
                    data:{
                        dataType: "json",
                        csrfmiddlewaretoken: '{{ csrf_token }}',
                        vname: $("#vname").val(),
                        city: $("#city").val(),
                        country: $("#country").val(),
                        companyCode: $("#company").val(),
                        uid: $("#uid").val(),
                    },
                    success: function(data) {
                        $('#item_result').text(data);
                        var dataObj = eval("("+data+")");
                        var out = "";
                        var i;
                        for(i = 0; i < dataObj.length; i++) {
                            fields = dataObj[i].fields
                            out += '<tr><td>'+ dataObj[i].pk+ '</td><td>' + fields.vname+ '</td><td>' + fields.city+ '</td><td>' + fields.country+ '</td><td>'+ fields.euser+ '</td><tr>';
                        }
                        document.getElementById("searchDiv").innerHTML=out;
                    },
                    failure: function() {

                    }
                })
            });
 //双击行 信息进入“搜索商品条件”三个框
 $("table").on("dblclick","tr",function(e){
    document.getElementById("gyscode").value=$(this).find('td').eq(0).text();
    $('#myModalgys').modal('hide');
});
        </script>

        </div>
        
        <div class="modal-footer">
          
        </div>
      </div>
    </div>
  </div>

<!--搜索供应商编码modal-->





              <div class="row mt">
                  <div class="col-md-12">
                    <div class="col-md-12">
                    <div class="content-panel">
                        <!-- <div class="form-panel2"> -->
                        
                        <table class="table table-striped table-advance table-hover">
                                <h4><i class="fa fa-angle-right"></i> 报价申请列表</h4>
                                <hr>
                            <thead>
                            <tr>
                                <th><i class="fa fa-bullhorn"></i> 报价申请单编码</th>
                                <th class="hidden-phone"><i class="fa fa-question-circle"></i> 创建者编码</th>
                                <th><i class="fa fa-bookmark"></i> 商品编码</th>
                                <th class="hidden-phone"><i class="fa fa-question-circle"></i> 供应商编码</th>
                                <th><i class=" fa fa-edit"></i> 创建时间</th>
                                <th> 操作</th>
                         
                            </tr>
                            </thead>
                            <tbody>
                                {% for c in quoatations %}
                                       <tr>
                                           <td>{{ c.id }} </td>
                                           <td>{{ c.euser_id }} </td>
                                           <td>{{ c.ri_id }} </td>
                                           <td>{{ c.vendor_id }} </td>
                                           <td>{{ c.time }} </td>
                                           <td>
                                               <!-- <button class="btn btn-success btn-xs"><i class="fa fa-check"></i></button> -->
                                      <a href="/mm/quotation/rfqinfo/{{c.id}}/"> <button class="btn btn-success btn-xs"><i class="fa fa-search-plus"></i></button> </a>   
                                           </td>
                                       </tr>
                                   {% endfor %}
           
                                 
                                      
                           
                            </tbody>
                        </table>
                    </div>
                    </div>
                     
                      </div>
                  </div><!-- /col-md-12 -->



   

              </div><!-- /row -->

		</section><! --/wrapper -->
      </section><!-- /MAIN CONTENT -->

      <!--main content end-->
      <!--footer start-->
      <footer class="site-footer">
          <div class="text-center">
              2014 - Alvarez.is
              <a href="purchase_request.html" class="go-top">
                  <i class="fa fa-angle-up"></i>
              </a>
          </div>
      </footer>
      <!--footer end-->
  </section>


    <!--script for this page-->
    
  <script>
      //custom select box

      $(function(){
          $('select.styled').customSelect();
      });

      function openInsertModal() {

//弹出模态框

$("#myModalcjz").modal("show")

}



  </script>

  </body>
</html>
